package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.YishiDao;
import com.entity.YishiEntity;
import com.entity.YonghuEntity;
import com.entity.view.WebsocketView;
import com.entity.view.YishiView;
import com.entity.view.YonghuView;
import com.service.YishiService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("yishiService")
public class YishiServiceImpl extends ServiceImpl<YishiDao, YishiEntity>implements YishiService {
    @Override
    public List<YishiEntity> selectListView(Wrapper<YishiEntity> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<YishiEntity> wrapper) {
        Page<YishiView> page =new Query<YishiView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<WebsocketView> selectUsernameByTable(List<String> username) {
        return baseMapper.selectUsernameByTable(username);
    }
}
